<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="stylesheet" type="text/css" href="../../css/style.css" />
		<link rel="stylesheet" type="text/css" href="../../css/demo.css" />
		<script src="../../js/demo.js" type="text/javascript" charset="utf-8"></script>
		<title>订单管理</title>
	</head>
	<body>
		<!--header-->
		<div class="header">
			<div class="header-content">
				<ul class="nav left">
					<li><img src="../../img/regist-arrow.png" /></li>
					<li class="nav-one">
						<a href="javascript:history.go(-1);">返回</a>
					</li>
					<li class="nav-two">
						<a href="../../">关闭</a>
					</li>
				</ul>
				<p class="left">订单管理</p>
				<div class="right nav_right">
					<img src="../../img/regist-list.png" />
				</div>
			</div>
		</div>
		<!--main-->
		<div class="main clear">
			<form action="">
			<div class="selfcenter-talk-pro">
				<div class="selfcenter-talk-line">
					
				</div>
				<div class="self-shop">
					<div class="self-shoptalk">
						<p>给店铺评分</p>
						<ul class="self-speed">
							<li class="left"style="margin-right: 0.39rem;">发货速度</li>
							<li><img src="../../img/self-talk2.png" onclick='selectLevel(0)'/></li>
							<li><img src="../../img/self-talk2.png" onclick='selectLevel(1)'/></li>
							<li><img src="../../img/self-talk2.png" onclick='selectLevel(2)'/></li>
							<li><img src="../../img/self-talk2.png" onclick='selectLevel(3)'/></li>
							<li><img src="../../img/self-talk2.png" onclick='selectLevel(4)'/></li>
						</ul>
						<ul class="self-attitude">
							<li class="left"style="margin-right: 0.39rem;">服务态度</li>
							<li><img src="../../img/self-talk2.png" onclick='selectLevel(0)'/></li>
							<li><img src="../../img/self-talk2.png" onclick='selectLevel(1)'/></li>
							<li><img src="../../img/self-talk2.png" onclick='selectLevel(2)'/></li>
							<li><img src="../../img/self-talk2.png" onclick='selectLevel(3)'/></li>
							<li><img src="../../img/self-talk2.png" onclick='selectLevel(4)'/></li>
						</ul>
					</div>
				</div>
			</div>
			    <input type="submit" value="发表评论" id="selftalk"/>
			</form>
			<div class="static-img">
				<img src="../../img/regist-back.png"/>
			</div>
		</div>	
		<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
		<script type="text/javascript">
		selectBillByBillCode();
			//根据订单编号查询订单
			function selectBillByBillCode(){
				//得到请求数据
				var billCode = location.search.substr(1);
				if(billCode==""){
					alert("该订单不存在！");
					history.go(-1);
				}
				//查询订单
				$.ajax({
					type:"post",
					url:"/qiaomengapp/bill/api/selectBillByBillCode/"+billCode,
					success:function(data){
						if(data==""){
							alert("该订单不存在！");
							history.go(-1);
						}else{
							for ( var billStr in data) {
								//得到订单对应商品
								var billGoods = data[billStr];
								for ( var i in billGoods) {
	
									var billGood = billGoods[i];
									
									$(".selfcenter-talk-line").append("<div class='selfcenter-talk-list'>"+
											"<img src='../../imgs/shopmanagement-icon.jpg' class='left'/>"+
											"<ul class='selfcenter-talk-listes'>"+
												"<li class='selfcenter-talk-one'><span>"+billGood.goodDesc+"</span>"+
						                            "<span class='right' style='color: #898989;'>￥"+billGood.price+"</span>"+
												"</li>"+
												"<li class='selfcenter-talk-thr'>颜色："+billGood.colorName+"； 鞋码："+billGood.size+"；<span class='right'>×"+billGood.num+"</span></li>"+
												"<li class='selfcenter-talk-two'>共<span>2</span>件商品<span>合计：</span><span>￥"+(billGood.price*billGood.num)+"</span></li>"+
											"</ul>"+
											"</div>"+
												"<ul class='selftalk' shopGoodId='"+billGood.shopGoodId+"'>"+
												"<li class='left' style='margin-right: 0.39rem;'>描述相符</li>"+
												"<li><img src='../../img/self-talk2.png' onclick='selectLevel(0)'/></li>"+
												"<li><img src='../../img/self-talk2.png' onclick='selectLevel(1)'/></li>"+
												"<li><img src='../../img/self-talk2.png' onclick='selectLevel(2)'/></li>"+
												"<li><img src='../../img/self-talk2.png' onclick='selectLevel(3)'/></li>"+
												"<li><img src='../../img/self-talk2.png' onclick='selectLevel(4)'/></li>"+
											"</ul>"+
											"<label class='selftalk-zan'>"+
												"<textarea name='selftalk' rows='' cols='' class='selfcenter-talktext' shopGoodId='"+billGood.shopGoodId+"'>东西真不错！赞</textarea>"+
											"</label>");
									
								}
							}
						}
					}
				});
			}
			
			//用户进行商品评价选择
			function selectLevel(level){
				//得到事件源
				var $img = $(event.target);
				$img.attr("src","../../img/self-talk.png");
				//得到事件源对应的ul元素
				var $ul = $img.closest("ul");
				//进行图片改变(事件源之前的图片进行选中，之后的图片进行未选中)
				$ul.find("img:lt("+level+")").attr("src","../../img/self-talk.png");
				
				$ul.find("img:gt("+level+")").attr("src","../../img/self-talk2.png");
			}
			
		</script>
	</body>
</html>